
<form id="GoodsForm" data-auto="true" method="post" action="{:request()->url()}" class='layui-form layui-card res_field_form' lay-filter="form_sub" autocomplete="off">
    <div class="layui-card-body think-box-shadow padding-left-40">

        <label class="layui-col-xs9 relative">
            <span class="color-green">主播分类</span>

            <select class="layui-select" required name="cate_id"   lay-search>
                <option selected value="">请选择分类</option>
                {foreach $category as $cate}
                {if isset($vo.cate_id) and $vo.cate_id eq $cate.id}
                <option selected value="{$cate.id}" >{$cate.spl|raw}{$cate.name|default=''}</option>
                {else}
                <option value="{$cate.id}"  {if $cate.pid eq 0}disabled{/if} >{$cate.spl|raw}{$cate.name|default=''}</option>
                {/if}
                {/foreach}
            </select>
        </label>

        <div class="layui-form-item">
            <span class="color-green label-required-prev">主播图片</span>
            <table class="layui-table">
                <thead>
                <!--<tr>-->
                    <!--<th class="text-left">主播图片</th>-->
                    <!--&lt;!&ndash;<th class="text-left">展示图片</th>&ndash;&gt;-->
                <!--</tr>-->
                <tr>
                    <td width="90px" class="text-left"><input name="img" type="hidden" value="{$vo.img|default=''}"></td>
                    <!--<td width="auto" class="text-left"><input name="imgs" type="hidden" value="{$vo.imgs|default=''}"></td>-->
                </tr>
                </thead>
            </table>
            <!--<script>$('[name="logo"]').uploadOneImage(), $('[name="imgs"]').uploadMultipleImage()</script>-->
            <script>$('[name="img"]').uploadOneImage()</script>
        </div>
        <div class="layui-form-item layui-row layui-col-space15">
            <span class="color-green label-required-prev">主播链接</span>
            <input name="link"  required class="layui-input" placeholder="请输入主播链接" value="{$vo.link|default=''}">
        </div>
        <div class="layui-form-item text-center">
            {notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
            <button class="layui-btn" type="submit" lay-submit lay-filter="form_sub">保存</button>
            <!--<button class="layui-btn layui-btn-danger" id="backBtn" data-confirm="确定要取消吗？" data-close type="button">取消</button>-->
        </div>
    </div>

    </div>
</form>
<script>
    window.form.render();
    require(['ckeditor', 'angular'], function () {
        window.createEditor('[name="content"]', {height: 300});

        // 监听返回按钮的点击事件
        document.getElementById('backBtn').onclick = function(){
            layer.confirm('确定要取消编辑吗？', function(index){
                history.back(); // 执行浏览器的返回操作
                layer.closeAll();
            })
        };
    })
</script>

